Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Dereference path parameters #962

Merged

Conversation

duncanbeevers
Copy link
Contributor

🐞 The Bug

The OpenAPI spec loader has a discoverRoutes method which explores an OpenAPI document and gathers information about the paths and parameters used.
The list of discovered path parameters is used to install parameter-specific middleware in src/openapi.validator.ts#installPathParams
Path parameters declared with $ref were not detected in the discoverRoutes implementation, leading to the un-coerced values being used.

The Fix 🔧

By dereferencing each path parameter when building this list, we should see the same behavior for referenced path parameters and for inline path parameters.

Closes #803

The OpenAPI spec loader has a `discoverRoutes` method which explores an OpenAPI document
and gathers information about the paths and parameters used.
The list of discovered path parameters is used to install parameter-specific middleware in `src/openapi.validator.ts#installPathParams`
Path parameters declared with `$ref` were not detected in the `discoverRoutes` implementation, leading to the un-coerced values being used.
By dereferencing each path parameter when building this list, we should see the same behavior for referenced path parameters and for inline path parameters.

Closes cdimascio#803
@cdimascio cdimascio merged commit 0aebe5d into cdimascio:master Sep 5, 2024
5 checks passed
@cdimascio
Copy link
Owner

Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parameters declared by $ref are skipped
2 participants